{extend name="/fool" /}
{block name="css"}
<link rel="stylesheet" href="/css/admin/bill_two.css">
<style>
    #title_one{
        font-size: 15px;
        line-height: 30px;
        border-bottom: 1px solid rgba(0,0,0,0.5);
    }
    #title_two{
        margin-bottom: 100px;
    }
    #title_two li{
        width:30vw;
        float: left;
    }
    .title_two_title{
        font-size: 16px;
        line-height: 50px;
    }
    .title_two_num{
        font-size: 18px;
    }
    #page{
        position: relative;
        display: inline-block;
        left:30%;
        margin-left:-50px;
        padding:50px 0;
    }
</style>
{/block}
{block name="menu_content"}
<div style="width:96vw;margin-left: 2vw;">
    <div id="one">
        <form class="layui-form" action="" method="post">
            <ul>
                <li style="margin-bottom: 20px;">
                    {if isset($status)}
                    {if $status == 1}
                    <button type="button" style="border-color: #44A1FF;color:#44A1FF;" class="sr layui-btn layui-btn-primary">收入</button>
                    <button type="button" style="color:#c7c7c7;" class="zc layui-btn layui-btn-primary">支出</button>
                    {else}
                    <button type="button" style="color:#c7c7c7;" class="sr layui-btn layui-btn-primary">收入</button>
                    <button type="button" style="border-color: #44A1FF;color:#44A1FF;" class="zc layui-btn layui-btn-primary">支出</button>
                    {/if}
                    {else}
                    <button type="button" style="border-color: #44A1FF;color:#44A1FF;" class="sr layui-btn layui-btn-primary">收入</button>
                    <button type="button" style="color:#c7c7c7;" class="zc layui-btn layui-btn-primary">支出</button>
                    {/if}
                </li>
                <li>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="test3" placeholder="2019-11">
                        </div>
                    </div>
                    <button type="button" class="dc layui-btn layui-btn-normal">导出表单</button>
                </li>
            </ul>
        </form>
    </div>
    <div>
        <table>
            <tr>
                <th>序号</th>
                <th>时间</th>
                <th>收入类型</th>
                <th>收入金额</th>
                <th>交易单号</th>
            </tr>
            {if isset($list)}
            {foreach $list as $v}
            <tr class="list">
                <td>{$v.id}</td>
                <td>{$v.create_time}</td>
                <td>{$v.moneyclass}</td>
                <td>{$v.money}</td>
                <td>{$v.transaction}</td>
            </tr>
            {/foreach}
            {/if}
        </table>
        <div id="page">
            {if isset($list)}
            {$page|raw}
            {/if}
        </div>
    </div>
</div>
<script>
    $(".sr").click(function () {
        "{if isset($riid)}"
        var url = "{:url('billview',['id'=>'7','index'=>'1','view'=>5,'bill'=>'1','status'=>'1'])}" + "&battery_order=" + "{$riid}"
        "{else}"
        var url = "{:url('billview',['id'=>'7','index'=>'1','view'=>5,'bill'=>'1','status'=>'1'])}" + "&battery_orderyue=" + "{$yueid}"
        "{/if}"
        location.href = url;
    })
    $(".zc").click(function(){
        "{if isset($riid)}"
        var url = "{:url('billview',['id'=>'7','index'=>'1','view'=>5,'bill'=>'1','status'=>'2'])}" + "&battery_order=" + "{$riid}"
        "{else}"
        var url = "{:url('billview',['id'=>'7','index'=>'1','view'=>5,'bill'=>'1','status'=>'2'])}" + "&battery_orderyue=" + "{$yueid}"
        "{/if}"
        location.href = url;
    })
    $(".dc").click(function(){
        var a = $("#test3").val();
        "{if $status == 1}"
        var url = "{:url('dcs',['status'=>'1'])}" + '&time=' + a;
        "{else}"
        var url = "{:url('dcs',['status'=>'2'])}" + '&time=' + a;
        "{/if}"
        location.href = url;
    })
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        //年月选择器
        laydate.render({
            elem: '#test3'
            ,type: 'month'
        });
    });
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //执行一个laypage实例
        laypage.render({
            elem: 'page'
            ,count: "{$count}"
            ,curr:"{$curl}"
            ,last:"{$groups}"
            ,limit:"{$limit}"
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
            ,jump: function(obj,first){
                console.log(obj)
                if(!first){
                    var url = "{:url('index',['id'=>5,'index'=>0])}" + '&page=' + obj.curr + '&limit=' + obj.limit + '&curr=' + obj.curr;
                    location.href = url;
                }
            }
        });
    });
</script>
{/block}